<script language="javascript">
  var x = 13, y = 29;
  function test() {
    var num, y = 10;
    num = x + y;
    x++
    document.write("内部的num的值为：" + num + "<br>");
  }
  test();
  document.write("测试x的值为：" + x + "<br>");
  document.write("测试y的值为：" + y + "<br>");
  document.write("外部的num的值为：" + num + "<br>");
</script>